package com.bdqn.springCloud.service;

import com.bdqn.springCloud.entity.CommonResult;
import com.bdqn.springCloud.entity.Payment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//@Component
@Configuration
@FeignClient("CLOUD-PAYMENT-SERVICE")  //eureka服务上注册的机器
public interface PaymentFeignService {
    //调用的是服务端controller层方法
    @GetMapping("/payment/get/{id}")
    CommonResult<Payment> getPaymentById(@PathVariable("id") Long id);

    @GetMapping("/payment/feign/timeout")
    String paymentFeignTimeout();
}
